<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.sdeport.common.vo.UserVO" %>
<%@ page import="com.sdeport.security.shiro.SDUtils" %>
<%@ page import="org.apache.shiro.UnavailableSecurityManagerException" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>山东电子口岸--跨境电子商务单一窗口门户</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="description" content="山东电子口岸"/>
    <meta name="keywords" content="山东电子口岸"/>
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <script type="text/javascript" src="${basePath}/js/jquery/jquery.min-1.11.3.js"></script>
    <script type="text/javascript" src="${basePath}/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="${basePath}/js/messagebox.js"></script>
    <link rel="stylesheet" href="${basePath}/css/base.css"/>
    <link rel="stylesheet" href="${basePath}/css/single.css"/>
    <script src="${basePath}/js/ggvSlide.js"></script>
    <script>
        $(function () {
            $('.banner').slide({
                counter: {auto: true, len: 'ul > li', duration: 5000, begin: 0},
                "ul": {active: FadeInSlide, param: {speed: "500"}, mouseover: "stop", mouseleave: "play"},
                "ol": {active: AddClassSlide, param: {css: "active"}, click: "choose"}
            });
        });
    </script>
    <!--[if lt IE 9]>
    <script src="${basePath}/js/html5shiv.js"></script>
    <![endif]-->
</head>

<body>
<!--头部 start-->
<div class="top">
    <div class="wrapper">
        <p class="welcome">您好，欢迎来到山东跨境电子商务单一窗口！</p>
        <a href="#">
            <%--<div class="notice"><sub>1</sub></div>--%>
        </a>

        <div class="cl"></div>
    </div>
</div>
<header>
    <div class="wrapper" style="padding-right: 0px">
        <script>
            function goToIndex(){
                var indexUrl = window.location.protocol + "//" + window.location.hostname;
                location.href = indexUrl;
            }
        </script>
        <a href="javascript:goToIndex()"><h1>山东跨境电子商务单一窗口
            <span>SHANDONG Cross-Border E-Commerce SingleWindow</span></h1></a>

        <p class="register" style="float: right !important;">你好，
            <span onclick="javascript: window.open('/pmc/main', '_self');" style="color: #085c99;cursor: pointer">
                ${sessionScope.UserInfo.name}
            </span>
            <a href="javascript:logout()" class="logout">注销</a>
            <%--<a href="javascript:editPassword()" class="pwd">修改密码</a>--%>
        </p>

        <p class="tel">热线电话：400-676-0166</p>

        <div class="cl"></div>
    </div>
</header>
<!--头部 end-->
<!--banner start-->
<div class="banner singleBanner">
    <ul>
        <li><img src="${basePath}/upload/banner1.jpg"/>
            <section>
                <div>热烈庆祝山东跨境单一窗口<h4>正式上线</h4></div>
            </section>
        </li>
        <li><img src="${basePath}/upload/banner2.jpg"/>
            <section>热烈庆祝山东跨境单一窗口<h4>正式上线</h4></section>
        </li>
        <li><img src="${basePath}/upload/banner3.jpg"/>
            <section>
                <div>热烈庆祝山东跨境单一窗口<h4>正式上线</h4></div>
            </section>
        </li>
    </ul>
    <ol>
        <li></li>
        <li></li>
        <li></li>
    </ol>
</div>
<!--banner end-->
<div class="wrapper portal" id="app">
    <h3 class="mainTitle">应用平台</h3>
    <!--备案管理 start-->
    <h4 class="subTitle">备案管理</h4>
    <ul class="sinList sinList1">
        <li><a name="myPlat" portalFlag="111">
            <figure><img src="${basePath}/upload/ico1_1.png"/></figure>
            <p>申报主体备案</p></a></li>
        <li><a name="myPlat" portalFlag="112">
            <figure><img src="${basePath}/upload/ico1_2.png"/></figure>
            <p>商品备案</p></a></li>
        <li><a name="myPlat" portalFlag="113">
            <figure><img src="${basePath}/upload/ico1_3.png"/></figure>
            <p>商品预归类查询</p></a></li>
    </ul>
    <!--备案管理 end-->
    <!--申报管理 start-->
    <h4 class="subTitle subTitle2">申报管理</h4>
    <ul class="sinList sinList2">
        <li><a name="myPlat" portalFlag="121">
            <figure><img src="${basePath}/upload/ico2_1.png"/></figure>
            <p>出口B2B</p></a></li>
        <li><a name="myPlat" portalFlag="122">
            <figure><img src="${basePath}/upload/ico2_2.png"/></figure>
            <p>出口B2C</p></a></li>
        <li><a name="myPlat" portalFlag="123">
            <figure><img src="${basePath}/upload/ico2_3.png"/></figure>
            <p>进口B2B</p></a></li>
        <li><a name="myPlat" portalFlag="124">
            <figure><img src="${basePath}/upload/ico2_4.png"/></figure>
            <p>进口B2C（直购）</p></a></li>
        <li><a name="myPlat" portalFlag="125">
            <figure><img src="${basePath}/upload/ico2_5.png"/></figure>
            <p>进口B2C（保税）</p></a></li>
    </ul>
    <!--申报管理 end-->
    <!--查询统计 start-->
    <h4 class="subTitle subTitle3">查询统计</h4>
    <ul class="sinList sinList3">
        <li><a name="myPlat" portalFlag="131">
            <figure><img src="${basePath}/upload/ico3_1.png"/></figure>
            <p>综合查询</p></a></li>
        <li><a name="myPlat" portalFlag="132">
            <figure><img src="${basePath}/upload/ico3_2.png"/></figure>
            <p>物流查询</p></a></li>
        <li><a name="myPlat" portalFlag="133">
            <figure><img src="${basePath}/upload/ico3_3.png"/></figure>
            <p>统计分析</p></a></li>
        <li><a name="myPlat" portalFlag="134">
            <figure><img src="${basePath}/upload/ico3_4.png"/></figure>
            <p>HS编码查询</p></a></li>
        <li><a name="myPlat" portalFlag="136">
            <figure><img src="${basePath}/upload/ico3_5.png"/></figure>
            <p>出口税则合并</p></a></li>
        <li><a name="myPlat" portalFlag="137">
            <figure><img src="${basePath}/upload/ico3_6.png"/></figure>
            <p>正面清单</p></a></li>
    </ul>
    <%
        boolean isAdmin = false;
        try {
            UserVO userVO = SDUtils.getCurrentUser();
            if (userVO != null) {
                isAdmin = userVO.getAdmin().booleanValue();
            }
        } catch (UnavailableSecurityManagerException e) {

        }
    %>
    <!--查询统计 end-->
    <h3 class="mainTitle" name="platFormShow">支撑平台</h3>
    <h4 class="subTitle subTitle4" name="platFormShow">基础框架</h4>
    <ul class="sinList sinList4 sinListNo" name="platFormShow">
        <li><a name="myPlat" portalFlag="201">
            <figure><img src="${basePath}/upload/ico4_1.png"/></figure>
            <p>数据交换</p></a></li>
        <%--<li><a name="myPlat" portalFlag="">--%>
        <%--&lt;%&ndash;portalFlag="202"&ndash;%&gt;--%>
        <%--<figure><img src="${basePath}/upload/ico4_2.png"/></figure>--%>
        <%--<p>用户管理</p></a></li>--%>
        <li><a name="myPlat" portalFlag="203">
            <figure><img src="${basePath}/upload/ico4_3.png"/></figure>
            <p>基础数据</p></a></li>
        <li><a name="myPlat" portalFlag="204">
            <figure><img src="${basePath}/upload/ico4_4.png"/></figure>
            <p>身份认证</p></a></li>
        <li><a name="myPlat" portalFlag="205">
            <figure><img src="${basePath}/upload/ico4_5.png"/></figure>
            <p>规则引擎</p></a></li>
        <%--<li><a name="myPlat" portalFlag="206">--%>
        <%--<figure><img src="${basePath}/upload/ico2_2.png"/></figure>--%>
        <%--<p>辅助系统</p></a></li>--%>
    </ul>

    <script>
        var user = "<%=isAdmin%>";
        if (user == 'true') {
            $("[name='platFormShow']").show();
        } else {
            $("[name='platFormShow']").hide();
        }
    </script>
</div>
<form id="subForm" action="${basePath}/mainPage" method="post">
    <input type="hidden" name="flag" id="flag">
    <input type="hidden" name="portalName" id="portalName">
</form>
<footer>
    <div class="wrapper">
        <address>版权所有 山东电子口岸 Copyright© 2015 sdeport.gov,cn All Rights Reserved<br/>鲁ICP备14042570号-2<br/>
        </address>
        <%--<img src="${basePath}/images/wechat.png"/>--%>

        <div class="cl"></div>
    </div>
</footer>
<ul class="float">
    <li><a href="#"><i class="float1"></i>常见问题</a></li>
    <li><a href="#"><i class="float2"></i>合作流程</a></li>
    <li><a href="#"><i class="float3"></i>API文档</a></li>
</ul>
<script>
    $(function () {
        var urlMap = {'201': "${transManagerUrl}"};
        $('.poaSearch').slide({
            counter: {auto: false, len: 'ul > li', duration: 3000, begin: 0},
            "ul": {active: AddClassSlide, param: {css: "active"}, click: "choose"},
            ".poaForm": {active: ShowSlide, param: {css: "active"}}
        });
        var tri = $(".tri");
        $('.poaSearch li').click(function () {
            var index = $(this).index();
            if (index == 0) {
                tri.stop().animate({"left": 170}, 300);
            }
            if (index == 1) {
                tri.stop().animate({"left": 360}, 300);
            }
        });
        $("a[name='myPlat']").click(function () {
            if ("" == $(this).attr("portalFlag")) {
                showWarningMsg("此功能暂未开放!");
            } else {
                if ($(this).attr("portalFlag") in urlMap) {
                    location.href = urlMap[$(this).attr("portalFlag")];
                    return;
                }
                $("#portalName").val($(this).find("p").html());
                $("#flag").val($(this).attr("portalFlag"));
                $("#subForm").submit();
            }
        });
    });

    function editPassword() {
        layer.open({
            type: 2,
            title: '修改密码',
            shadeClose: true,
            shade: [0.3, '#000'],
            area: ['1000px', '600px'],
            content: '${basePath}/user/editPasswd'
        });
    }
    function logout() {
        showConfirm("确认注销吗？", '', function () {
            $.ajax({
                type: "GET", url: "/pmc/security/logout"
            });
            $.ajax({
                type: "GET", url: "/portal/security/logout"
            });
            $.ajax({
                type: "GET", url: "/cargo/security/logout"
            });
            $.ajax({
                type: "GET", url: "/vehicle/security/logout"
            });
            top.location.href = $basePath + '/security/logout';
        });
    }
    //    注册进入直接注销
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }
    if ("0" == getQueryString("type")) {
        $.ajax({
            type: "GET", url: "/pmc/security/logout"
        });
        $.ajax({
            type: "GET", url: "/portal/security/logout"
        });
        $.ajax({
            type: "GET", url: "/cargo/security/logout"
        });
        $.ajax({
            type: "GET", url: "/vehicle/security/logout"
        });
        top.location.href = $basePath + '/security/logout';
    }
</script>
</body>
</html>
